﻿@model SAD.Models.Account
@{
    ViewBag.Title = "Register";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Register</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)
    if (!string.IsNullOrEmpty(ViewBag.erro))
    {
    <h2 style="color: red">@ViewBag.erro</h2>
    }
    <fieldset>
        <legend>Account</legend>



        <div class="editor-label">
            User Name
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.username)
            @Html.ValidationMessageFor(model => model.username)
        </div>

        <div class="editor-label">
            Password
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.password)
            @Html.ValidationMessageFor(model => model.password)
        </div>

        <div class="editor-label">
            Full Name
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.fullname)
            @Html.ValidationMessageFor(model => model.fullname)
        </div>

        <div class="editor-label">
            Address
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.address)
            @Html.ValidationMessageFor(model => model.address)
        </div>

        <div class="editor-label">
            Phone 
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.phone)
            @Html.ValidationMessageFor(model => model.phone)
        </div>

        <p>
            <input type="submit" value="Create" />
        </p>
    </fieldset>
}